#pragma once

#include <string>
using namespace std;

class CStringConvert
{
public:
	CStringConvert(void);
	virtual ~CStringConvert(void);
	static string AnsiToUtf8(string ansiString);
	static string Utf8ToAnsi(string utf8String);
	static string UrlEncode(string url);
	static string UrlDecode(string url);

private:
	static string Convert(string str, int sourceCodepage, int targetCodepage);
	static int UTF82GBK(char *szUtf8,char *szGbk,int Len); 
	static int GBK2UTF8(char *szGbk,char *szUtf8,int Len);

public:
	static wstring AsciiToUnicode(string asciiStr);
	static string UnicodeToAscii(wstring unicodeStr);
	static wstring Utf8ToUnicode(string utf8Str);
	static wstring UnicodeToChinese(wstring wStrUnicode);
};

